import http from '../index'

// 分页获取保藏类型
export const getPreserves = ({ ascended = null, current = null, size = null, sortFieldName = null, status = null, preserveCode = null, preserveName = null }) => {
    return http.get("preserves", { ascended, current, size, sortFieldName, status, preserveCode, preserveName })
}

// 获取所有保藏类型
export const getPreservesAll = () => {
    return http.get("preserves/all")
}

// 根据sid获取保藏类型
export const getPreserveDetail = ({ sid }) => {
    return http.get("preserves/" + sid)
}

// 新增保藏类型
export const addPreserve = ({ preserveName, preserveCode, note, status = null }) => {
    return http.post("preserves", { preserveName, preserveCode, note, status })
}

// 修改保藏类型
export const editPreserve = ({ sid, preserveName, preserveCode, note, status = null }) => {
    return http.put("preserves/" + sid, { preserveName, preserveCode, note, status })
}

// 批量删除保藏类型
export const delPreserves = ({ sidList }) => {
    return http.put("preserves/delete", { sidList })
}

// 根据sid启用-停用保藏类型
export const changePreserveStatus = ({ sid }) => {
    return http.put("preserves/" + sid + '/status')
}



